home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / TCP_IP / TNOS230S / SESSION.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-19  |  3.1 KB  |  128 lines

  1. /* Mods by PA0GRI */
  2. #ifndef    _SESSION_H
  3. #define    _SESSION_H
  4.  
  5. #ifndef _STDIO_H_
  6. #define _STDIO_H_    1
  7. #include <stdio.h>
  8. #endif
  9.  
  10. #ifndef    _GLOBAL_H
  11. #include "global.h"
  12. #endif
  13.  
  14. #ifndef    _PROC_H
  15. #include "proc.h"
  16. #endif
  17.  
  18. #ifndef _lint
  19. struct session;
  20. #endif
  21.  
  22. #ifndef _HARDWARE_H
  23. #include "hardware.h"
  24. #endif
  25.  
  26.  
  27. #ifndef    _FTPCLI_H
  28. #include "ftpcli.h"
  29. #endif
  30.  
  31. #ifndef    _TELNET_H
  32. #include "telnet.h"
  33. #endif
  34.  
  35. #ifndef _DIRUTIL_H
  36. #include "dirutil.h"
  37. #endif
  38.  
  39. #define    MOREROWS    24    /* rows on screen before --more-- */
  40.  
  41. struct ttystate {
  42.     struct mbuf *line;    /* Line buffer */
  43.     int echo;        /* Keyboard local echoing? */
  44.     int edit;        /* Local editing? */
  45.     int crnl;        /* Translate cr to lf? */
  46. };
  47.  
  48. /* Session control structure; only one entry is used at a time */
  49. struct session {
  50.     int type;
  51. #define    FREE    0
  52. #define    TELNET    1
  53. #define    FTP    2
  54. #define    AX25TNC    3
  55. #define    FINGER    4
  56. #define    PING    5
  57. #define NRSESSION 6
  58. #define    COMMAND    7
  59. #define    MORE    8
  60. #define    HOP    9
  61. #define    TIP    10
  62. #define    PPPPASS    11
  63. #define DIAL    12
  64. #define DQUERY    13
  65. #define DCLIST    14
  66. #define    RLOGIN    15
  67. #define TRACESESSION 16
  68. #define VIEW    17
  69. #define SCRIPT  18
  70. #define REPEAT  19
  71. #define RESOLVE 20
  72. #define DNSQUERY 21
  73. #define LOOK    22
  74. #define AXUITNC 23
  75.  
  76.     char *name;    /* Name of remote host */
  77.     union {
  78.         struct ftpcli *ftp;
  79.         struct telnet *telnet;
  80.     } cb;
  81.     struct proc *proc;    /* Primary session process (e.g., tn recv) */
  82.     struct proc *proc1;    /* Secondary session process (e.g., tn xmit) */
  83.     struct proc *proc2;    /* Tertiary session process (e.g., upload) */
  84.     int s;            /* Primary network socket (control for FTP) */
  85.     FILE *record;        /* Receive record file */
  86.     char *rfile;        /* Record file name */
  87.     FILE *upload;        /* Send file */
  88.     char *ufile;        /* Upload file name */
  89.     struct ttystate ttystate;
  90.     struct screen *screen;
  91.     int input;        /* Input socket */
  92.     int output;        /* Output socket */
  93.     int flowmode;        /* control "more" mode */
  94.     int row;        /* Rows remaining until "more" */
  95.     int morewait;        /* Output driver is waiting on us */
  96.     int tsavex;        /* Save for x top screen */
  97.     int tsavey;        /* Save for y top screen */
  98.     int bsavex;        /* Save for x bottom screen */
  99.     int bsavey;        /* Save for y bottom screen */
  100.     int split;        /* Signal for split screen */
  101.     struct cur_dirs *curdirs; 
  102.     int index;        /* session # (0 - (Nsessions - 1)) */
  103. };
  104. #define    NULLSESSION    (struct session *)0
  105.  
  106. extern const char *Sestypes[];
  107. extern unsigned Nsessions;        /* Maximum number of sessions */
  108. extern struct session *Sessions;    /* Session descriptors themselves */
  109. extern struct session *Current;        /* Always points to current session */
  110. extern struct session *Lastcurr;    /* Last non-command session */
  111. extern struct session *Command;        /* Pointer to command session */
  112.  
  113. /* In session.c: */
  114. void freesession (struct session *sp);
  115. struct session *sessptr (char *cp);
  116. struct session *newsession (const char *name,int type,int split);
  117. extern char TooManySessions[];
  118.  
  119. /* In pc.c: */
  120. #ifndef _UNIX_H
  121. void swapscreen (struct session *old,struct session *new);
  122. #endif
  123.  
  124. #define    ALERT_EOF    1
  125.  
  126.  
  127. #endif    /* _SESSION_H */
  128.